JAVA = java
JAVAC = javac
CLASSPATH = .:./pj2.jar

NAME = Fryzel
DOC = ../doc

.SUFFIXES: .java .class
.java.class:
	$(JAVAC) -classpath $(CLASSPATH) $<
SOURCES = Parser.java Interpreter.java InterpreterElementDoVisitor.java
CLASSES = Parser.class Interpreter.class InterpreterElementDoVisitor.class

all: pj2 $(CLASSES)

pj2:
	wget -N http://www.cs.rit.edu/~ats/projects/lp2/pj2/pj2.jar

clean:
	rm -Rf $(CLASSES) *.class *.jar pj2* META-INF doc

dist: distreq Parser_$(NAME).jar Interpreter_$(NAME).jar

distreq: pj2
	cd $(DOC); make doc; cd ../src
	cp -R $(DOC) .

Parser_$(NAME).jar: all
	jar xf pj2.jar
	jar cfe $@ Parser *

Interpreter_$(NAME).jar: all
	jar xf pj2.jar
	jar cfe $@ Interpreter *
